Skip to content

Fix Windows Crash via subprocess isolation - #164

Closed
Fristender wants to merge 2 commits into
1038lab:mainfrom
Fristender:main
Closed

Fix Windows Crash via subprocess isolation#164
Fristender wants to merge 2 commits into
1038lab:mainfrom
Fristender:main

Conversation

@Fristender

Copy link
Copy Markdown

2 Commits:
Fix Windows RMBG-2.0 crash via subprocess isolation
On some Windows setups, executing the bundled RMBG-2.0 model code can crash the host process (torch_cpu.dll access violation).

Run RMBG-2.0 inference in a separate Python subprocess by default on Windows and return the generated masks back to the node.

Add opt-in debug markers (COMFYUI_RMBG_DEBUG_PROGRESS) and toggles (COMFYUI_RMBG_RMBG2_SUBPROCESS, COMFYUI_RMBG_DEBUG_KEEP_TEMP).

Make optional deps non-fatal on Windows; lazy-import SAM3
Skip groundingdino-py installation on Windows (optional; node already falls back when unavailable).

Lazy-import SAM3 internals so missing assets/deps don’t break ComfyUI startup.

On some Windows setups, executing the bundled RMBG-2.0 model code can crash the host process (torch_cpu.dll access violation).

Run RMBG-2.0 inference in a separate Python subprocess by default on Windows and return the generated masks back to the node.

Add opt-in debug markers (COMFYUI_RMBG_DEBUG_PROGRESS) and toggles (COMFYUI_RMBG_RMBG2_SUBPROCESS, COMFYUI_RMBG_DEBUG_KEEP_TEMP).
Skip groundingdino-py installation on Windows (optional; node already falls back when unavailable).

Lazy-import SAM3 internals so missing assets/deps don’t break ComfyUI startup.
@1038lab

1038lab commented Jan 13, 2026

Copy link
Copy Markdown
Owner

Appreciate the explanation. we’ll review the code in detail before making a decision on this PR.

@1038lab

1038lab commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Thanks for your contribution! we have natively resolved the Windows compatibility and crash issues (such as transformers >= 5.0.0 bertwarper/backbone fixes, tensor normalization, and SAM3 safetensors multiplex architecture) directly within the main process without subprocess disk I/O overhead. As a result, subprocess isolation is no longer needed. Closing this PR.

@1038lab 1038lab closed this Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants